package com.cyl.manager.vip.domain.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseAudit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * VIP兑换码对象 vip_exchange_code
 *
 * @author system
 */
@ApiModel(description="VIP兑换码对象")
@Data
@TableName("vip_exchange_code")
public class VipExchangeCode extends BaseAudit {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("兑换码ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("兑换码")
    @Excel(name = "兑换码")
    private String code;

    @ApiModelProperty("VIP配置ID")
    @Excel(name = "VIP配置ID")
    private Long rechargeDataId;

    @ApiModelProperty("VIP类型")
    @Excel(name = "VIP类型")
    private String vipType;

    @ApiModelProperty("VIP天数")
    @Excel(name = "VIP天数")
    private Integer vipDays;

    @ApiModelProperty("原价")
    @Excel(name = "原价")
    private BigDecimal originalPrice;

    @ApiModelProperty("折扣价")
    @Excel(name = "折扣价")
    private BigDecimal discountPrice;

    @ApiModelProperty("状态（0：未使用，1：已使用，2：已过期）")
    @Excel(name = "状态", readConverterExp = "0=未使用,1=已使用,2=已过期")
    private Integer status;

    @ApiModelProperty("使用用户ID")
    @Excel(name = "使用用户ID")
    private Long usedUserId;

    @ApiModelProperty("使用时间")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime usedTime;

    @ApiModelProperty("过期时间")
    @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireTime;

    // 状态常量
    public static final int STATUS_UNUSED = 0;    // 未使用
    public static final int STATUS_USED = 1;      // 已使用
    public static final int STATUS_EXPIRED = 2;   // 已过期
}